//    Copyright (C) Kherty.  All rights reserved.
using OpenLS.Core.Serialization;

namespace OpenLS.Drawing
{
    internal class TextAutonumberBullet : TextBullet
    {
        private TextAutonumberScheme type;
        private int startAt;

        internal override void ReadXmlCore(ReadContext context)
        {
            using (var c = context.Read("buAutoNum"))
            {
                type = c.GetOptionalEnum<TextAutonumberScheme>("type", TextAutonumberScheme.ArabicPlain); //\\ should be GetEnum but ppt OK with no type.
                startAt = c.GetOptionalInteger("startAt", 1);
            }
        }

        internal override void WriteXmlCore(WriteContext context)
        {
            using (var c = context.Write("buAutoNum"))
            {
                c.SetEnum("type", type );
                c.SetOptionalInteger("startAt",startAt,  1  );
            }
        }
    }
}